package cn.ycc1.myupper.model;

import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * DeepSeek SpringAI接入
 * @author ycc
 * @date 2025/4/29
 */
@RestController
public class DeepSeekChatModelController {
    private static final String prompt = "你是谁";
    private final ChatModel deepSeekChatModel;

    public DeepSeekChatModelController (ChatModel chatModel) {
        this.deepSeekChatModel = chatModel;
    }

    @GetMapping("/v3/simple/chat")
    public String simpleChat () {

        return deepSeekChatModel.call(new Prompt(prompt)).getResult().getOutput().getText();
    }
}
